<?
//the example of inserting data with variable from HTML form
//input.php
mysql_connect("129.74.153.54","HA_User","hag") or die (mysql_error());//database connection
mysql_select_db('HA_database') or die (mysql_error());

//get values from POST
   $p_name=$_POST['structureName'];
   $p_age=$_POST['nChildren'];
   $p_zip=$_POST['yearBuilt'];


$patient = "INSERT INTO example
			(name, age, zipcode)
			VALUES
			('$p_name',
			'$p_age',
			'$p_zip'
			)";



$result = mysql_query($patient);	//patient added executes
if($result){
	echo("<br>Patient add succeed");
	header("Location:test.php");
} else{
	echo("<br>Patient add failed");
}
?>

